package 实验2;

public class Test {
	public static void main(String[] args) {

		Teacher teacher = new Teacher("0919", "崔老师", "男");
		

		Course course = new Course("123", "Java", "综合实验楼0921", "周一 10:00-24:00");
		course.setTeacher(teacher);
		teacher.settaughtClass(course);

		Student student = new Student("2024311063", "波奇", "男");
		student.selectCourse(course);
		System.out.println("学生 " + student.getName() + " 选课成功，课程：" + course.getName());

		System.out.println("学生课表：");
		Course selectedCourse = student.getSelectedCourse();
		if (selectedCourse != null) {
			System.out.println("编号：" + selectedCourse.getId());
			System.out.println("课程名称：" + selectedCourse.getName());
			System.out.println("上课地点：" + selectedCourse.getLocation());
			System.out.println("时间：" + selectedCourse.getTime());
			System.out.println("授课教师：" + selectedCourse.getteacher().getName());
		}else {
			System.out.println("暂无选课记录");
		}
		

		student.dropCourse();
		System.out.println("学生 " + student.getName() + " 退课成功");

		System.out.println("退课后学生课表：");
		selectedCourse = student.getSelectedCourse(); 
		if (selectedCourse != null) {
            System.out.println("编号：" + selectedCourse.getId());
            System.out.println("课程名称：" + selectedCourse.getName());
            System.out.println("上课地点：" + selectedCourse.getLocation());
            System.out.println("时间：" + selectedCourse.getTime());
            System.out.println("授课教师：" + selectedCourse.getteacher().getName());
        } else {
            System.out.println("暂无选课记录");
        }
	}
}
